package com.longge;

public class BatteryPercentages {

    public int countTestedDevices(int[] batteryPercentages) {

        int subCount = 0,ans =0;
        for (int batteryPercentage : batteryPercentages) {
            if (batteryPercentage-subCount>0){
                ans++;
                subCount++;
            }
        }
        return ans;
    }

}
